<?
/**************************************/
	if ($this->user->id):
	?>
		<div id="loginDiv">
			<span id="helloSpan">
				<? if ($this->user->service == 'vk'):?>
					<img width="12" height="12" src=<?=base_url()?>"templ/<?=getTemplate()?>/img/oauth/sicon_vk.png">
				<? elseif ($this->user->service == 'twitter'):?>
					<img width="12" height="12" src=<?=base_url()?>"templ/<?=getTemplate()?>/img/oauth/sicon_twitter.png">
				<? elseif ($this->user->service == 'fb'):?>
					<img width="12" height="12" src=<?=base_url()?>"templ/<?=getTemplate()?>/img/oauth/sicon_facebook.png">
				<? elseif ($this->user->service == 'mailru'):?>
					<img width="12" height="12" src=<?=base_url()?>"templ/<?=getTemplate()?>/img/oauth/sicon_mailru.png">
				<? elseif ($this->user->service == 'ok'):?>
					<img width="12" height="12" src=<?=base_url()?>"templ/<?=getTemplate()?>/img/oauth/sicon_ok.png">
				<? endif;?>
				Привет, <?=$this->user->data->pName?>!
			</span>
			<a href="#" id="logoutLink">Выйти</a>
			<? if ($this->user->data->pAdmin || $this->user->data->pModer):?>
				| <a href="<?=base_url()?>admin">Админка</a>
			<? endif;?>
		</div>
	<?
	else:
	?>
	<div id="loginDiv">
		<form method="post" id="loginForm">
			<div>
				<input id="loginDivLogin" placeholder="Email" name="login" type="text" value=""/>
				<input id="loginDivPassword" placeholder="Пароль" name="password" type="password" value=""/>
				<input id="loginDivPasswordHidden" name="password" type="hidden" value=""/>
				<input type="submit" value="ВОЙТИ" id="loginDivSubmit" />
			</div>
			<div id="loginFormHeadDiv">
				<div id="ssAuthDiv">
					<? if ($this->settings->data->pVKAuth): ?>
					<a href="<?=base_url()?>registration/vk_auth"><img width="20" height="20" src="<?=base_url()?>templ/<?=getTemplate()?>/img/oauth/sicon_vk.png" alt="vkontakte" title="Войти через ВКонтакте"></a>
					<? endif; ?>
					
					<? if ($this->settings->data->pTwitterAuth): ?>
					<a href="<?=base_url()?>registration/twitter_auth"><img width="20" height="20" src="<?=base_url()?>templ/<?=getTemplate()?>/img/oauth/sicon_twitter.png" alt="twitter" title="Войти через Twitter"></a>
					<? endif; ?>

					<? if ($this->settings->data->pFBAuth): ?>
					<a href="<?=base_url()?>registration/facebook_auth"><img width="20" height="20" src="<?=base_url()?>templ/<?=getTemplate()?>/img/oauth/sicon_facebook.png" alt="facebook" title="Войти через Facebook"></a>
					<? endif; ?>
					
					<? if ($this->settings->data->pMailruAuth): ?>
					<a href="<?=base_url()?>registration/mailru_auth"><img width="20" height="20" src="<?=base_url()?>templ/<?=getTemplate()?>/img/oauth/sicon_mailru.png" alt="mail.ru" title="Войти через Mail.ru"></a>
					<? endif; ?>

					<? if ($this->settings->data->pOKAuth): ?>
					<a href="<?=base_url()?>registration/ok_auth"><img width="20" height="20" src="<?=base_url()?>templ/<?=getTemplate()?>/img/oauth/sicon_ok.png" alt="одноклассники" title="Войти через Одноклассники"></a>
					<? endif; ?>
				</div>
				<a href="<?=base_url()?>registration">Регистрация</a> /
				<a href="<?=base_url()?>registration/forgot_password">Забыли пароль?</a>
			</div>
			<div id="loginResponse"></div>
		</form>
	</div>
	<?
	endif;
/**************************************/
?>